<?php

/*************************************************************************

	FILE INCLUDE

**************************************************************************/
include_once '../lib/Template.class.php';
$debug_mode_value = 0;



/*************************************************************************

	USER SCRIPT

***************************************************************************/
$userscript =<<<js
    <script type="text/javascript">
        <!--

        //-->
    </script>
js;


/*************************************************************************

		PAGE MAIN PROCESS

***************************************************************************/
(!empty($_POST['user_cd']))? $user_cd = $_POST['user_cd'] : $user_cd = 0;
(!empty($_POST['user_id']))? $user_id = $_POST['user_id'] : $user_id = "";
(!empty($_POST['user_pw']))? $user_pw = $_POST['user_pw'] : $user_pw = "";
(!empty($_POST['user_nm']))? $user_nm = $_POST['user_nm'] : $user_nm = "";
(!empty($_POST['admin_chk']))? $admin_chk = 1 : $admin_chk = 0;
(!empty($_POST['operation']))? $operation = $_POST['operation'] : $operation = "";



print_rr($_POST);

if($operation=="insert"){
	$db->conn();

	$query="INSERT INTO user_tb
			(USER_ID, USER_NM, USER_PW, USER_LV, REGISTER_DT, REGISTER_USER)
			VALUES ('$user_id', '$user_nm', '$user_pw', $admin_chk, now(), 1);";
	$db->query($query);

	$db->close();
}else if ($operation="delete"){
	$db->conn();

	$query="DELETE FROM user_tb
			WHERE USER_CD = $user_cd ";
	$db->query($query);

	$db->close();
}

/*************************************************************************

	TEMPLATE PROCESS

***************************************************************************/
$JSClass->replace("./UserManagement.php");





/*************************************************************************

	AJAX FUNCTION : Template_ function

***************************************************************************/



















?>
